<?php
session_start();
require_once('Controller/LoginController.php');
require_once('Controller/RegController.php');
require_once('View/NavView.php');

class MasterController{
	public static function DoControll(){
		$navView = new NavView();
		$html = $navView->DoNavigationBox();
		
		//Visar registreringsformulär om $navView->IsRegister() returnerar true, annars
		//visas loginformulär
		if($navView->IsRegister()){
			$regController = new RegController();
			$html .= $regController->DoControll();
		}
		else{
			$loginController = new LoginController();
			$html .= $loginController->DoControll();			
		}
		return $html;
	}
}

?>
<html>
  <head>
    <title><?php echo $title; //Skriver ut titeln för sidan?></title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link href="css/style.css" rel="stylesheet" type="text/css" media="screen">
  </head>
  <body>
  <?php
    //Skriver ut bodyn för sidan
    echo MasterController::DoControll();
  ?>
  </body>
</head>